<template>
	<view class="main">
		<view class="course-cont">
			<view class="cont-top">
				<view class="tabbar" :class="{active:i==current}" v-for="(item,i) in tabbarList" :key="i" @click="clickTabbar(i)">
					{{item.title}}
				</view>
			</view>
			<view class="" v-if="current == 0">
				<u-image src="https://heroes.nosdn.127.net/a/images/2020/7/28/ed8237653d64482cbe6608839fac0182.jpg" width="100%" height="300rpx" border-radius="20">
					<u-loading slot="loading"></u-loading>
				</u-image>
			</view>
			<view class="" v-if="current == 1">
				<u-button @click="goInfo()">任务详情</u-button>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tabbarList:[{
					title:'课程任务'
				},
				{
					title:'实践任务'
				}],
				current:0
			}
		},
		onLoad(opt) {
			//console.log(opt);
		},
		methods: {
			clickTabbar(index) {
				this.current = index
			},
			goInfo() {
				uni.navigateTo({
					url:'/pageTask/sjInfo'
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.cont-top{
		width: 100%;
		height: 80rpx;
		display: flex;
		
		.tabbar{
			flex: 1;
			text-align: center;
			
			&.active{
				border-bottom: 2rpx solid #000;
			}
		}
	}
</style>
